<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored ="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
  <meta charset="UTF-8">
  <title>新增</title>
  <link rel="stylesheet" href="${basePath}style.css">
  <link rel="stylesheet" href="${basePath}font-awesome-4.7.0/css/font-awesome.min.css">
</head>
<body>
<div class="add">
  <form class="addForm" action="${basePath}course?method=add" method="post">
    <table class="tableadd">
      <tr>
        <td>课程ID :</td>
        <td><input type="text" name="courseId"></td>
      </tr>
      <tr>
        <td>课程名称:</td>
        <td><input type="text" name="courseName"></td>
      </tr>
      <tr>
        <td>老师</td>
        <td>
          <select name="tid">
            <option value="">请选择老师</option>
            <c:forEach items="${teachers}" var="teacher">
              <option value="${teacher.tid}">${teacher.teaName}</option>
            </c:forEach>
          </select>
        </td>
      </tr>
      <tr>
        <td colspan="4" align="left" >
          <button class="edit" onclick="window.history.back(-1);">
            <i class="fa fa-arrow-left"></i>
            返回
          </button>
          <button class="remove" type="submit">
            <i class="fa fa-save"></i>
            提交
          </button>
        </td>
      </tr>
    </table>
  </form>
</div>
</body>
<script src="https://code.jquery.com/jquery-3.6.0.min.js" type="text/javascript"></script>
<script  src="${basePath}validation/jquery.validate.js" type="text/javascript"></script>
<script  src="${basePath}validation/localization/messages_zh.js" type="text/javascript"></script>
<script>
  $(function(){
    $('.addForm').validate({
      rules:{
        courseId: "required",
        courseName:"required",
        tid:"required"
      }
    });
  });
</script>
</html>
